package cn.heima.com;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class DateDemo4 {
    public static void main(String[] args) throws ParseException {
        String strat="2020-11-11 00:00:00";
        String end ="2020-11-11 00:10:00";

        String xiaohei = "2020-11-11 00:03:15";
        String xiaopi ="2020-11-11 00:10:55";
        long  stratTime =  getMethod(strat);
        long  endTime = getMethod(end);
        long  xiaoH= getMethod(xiaohei);
        long  xiaoP= getMethod(xiaopi);

    }
    public  static long getMethod(String string) throws ParseException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
        long s = simpleDateFormat.parse(string).getTime();
    return s;
    }
}
